package com.codeoss.framework.webide.app.service.store;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

import com.codeoss.framework.context.YunContext;
import com.codeoss.framework.webide.app.service.IAppDataHandler;

@Service
public class AppDataHandlerStore implements IAppDataHandlerStore,ApplicationContextAware {
    private ApplicationContext applicationContext;
    
	@Override
	public IAppDataHandler getAppDataHandlerByTable(YunContext yunContext, String tableName) {
		// TODO Auto-generated method stub
		return (IAppDataHandler)applicationContext.getBean(tableName+"AppDataHandler");
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		// TODO Auto-generated method stub
		this.applicationContext=applicationContext;
	}

}
